Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix collapsed menu issue on page reload #2440

Merged

Conversation

MaratheHarshad
Copy link
Contributor

Description

This PR addresses an issue with the collapsible menu where the menu wouldn't expand properly after a page reload. The root cause was the incorrect calculation of max-height.

Closes #2265

Key Changes:

  1. Fixed the calculation of max-height by using the scrollHeight property.
  2. Updated the CSS box-sizing property to content-box to ensure padding is included in the element's overall size, resolving layout issues when expanding the menu.

These changes ensure that the menu expands and collapses smoothly, both after a reload and on user interaction.

stirling.-.collapsible.menus.expansion.after.reload.mp4

Checklist

  • I have read the Contribution Guidelines
  • I have performed a self-review of my own code
  • I have attached images of the change if it is UI based
  • I have commented my code, particularly in hard-to-understand areas
  • If my code has heavily changed functionality I have updated relevant docs on Stirling-PDFs doc repo
  • My changes generate no new warnings
  • I have read the section Add New Translation Tags (for new translation tags only)

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 12, 2024
@github-actions github-actions bot added the Front End Issues or pull requests related to front-end development label Dec 12, 2024
@dosubot dosubot bot added the Bug Something isn't working label Dec 12, 2024
@Frooodle Frooodle merged commit 50c5efa into Stirling-Tools:main Dec 12, 2024
5 of 6 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug Something isn't working Front End Issues or pull requests related to front-end development size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Collapsible menus on reload (with state closed saved) don't re-expand correctly
2 participants